﻿using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BBICMS.Model.View
{
    public class PositionListVM
    {
        public IList<Position> Positions { get; set; }

        public string PositionsJSON
        {
            get
            {
                JsonSerializerSettings settings =
                    new JsonSerializerSettings()
                    {
                        ReferenceLoopHandling = ReferenceLoopHandling.Ignore
                    };

                settings.ContractResolver =
                    new CamelCasePropertyNamesContractResolver();

                var positions = JsonConvert.SerializeObject(this.Positions, settings);
                return positions;
            }
        }
    }
}
